package org.gradle.internal.fingerprint;


import com.google.common.hash.HashCode;
import org.gradle.internal.snapshot.FileSystemLocationSnapshot;
import org.gradle.internal.snapshot.FileSystemSnapshot;

import java.util.Map;

/**
 * Strategy for converting a sequence of {@link FileSystemLocationSnapshot}s into a {@link FileCollectionFingerprint}.
 */
public interface FingerprintingStrategy {

    // TODO wolfs: Move these identifiers to the actual strategy classes when they live in :snapshots
    String CLASSPATH_IDENTIFIER = "CLASSPATH";
    String COMPILE_CLASSPATH_IDENTIFIER = "COMPILE_CLASSPATH";

    /**
     * Converts the roots into the {@link FileSystemLocationFingerprint}s used by the {@link FileCollectionFingerprint}.
     */
    Map<String, FileSystemLocationFingerprint> collectFingerprints(FileSystemSnapshot roots);

    /**
     * Used by the {@link FileCollectionFingerprint} to hash a map of fingerprints generated by {@link #collectFingerprints(FileSystemSnapshot)}
     */
    FingerprintHashingStrategy getHashingStrategy();

    String getIdentifier();

    CurrentFileCollectionFingerprint getEmptyFingerprint();

    String normalizePath(FileSystemLocationSnapshot snapshot);

    HashCode getConfigurationHash();
}